<template>
  <chart :options="opts" :width="width" :height="height"></chart>
</template>

<script>
export default {
  name: 'Pie',

  props: ['width', 'height', 'options'],

  computed: {
    opts () {
      let defaultOptions = {
        tooltip: {
          trigger: 'item',
          formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        series: [{
          name: '',
          type: 'pie',
          radius: '55%',
          center: ['50%', '50%'],
          data: []
        }]
      }

      return _.merge({}, defaultOptions, this.options)
    }
  }
}
</script>

<style lang="css">
</style>
